<%= render  :partial => "apo/navigation" %>

<div id="containerBody">
    <% if session[:user].admin %>
      <% if flash[:notice] %>
      	<h2><%=h flash[:notice] %></h2>
    	<% end %>

      <% form_tag :action => "admin" do %>

    		<div class="container" style="float: left;">
          <h5>SRC</h5>
          To require everyone to read and sign the SRC again, <%= submit_tag "Reset SRC" %><br>
          <%= submit_tag "Toggle SRC" %>
  				SRC requirement is currently <%=h @srcToggle?"on":"off" %>
          <h5>Create a pledge class</h5>
          <%= text_field_tag "pledgeclass" %>
          <%= submit_tag "Create" %>

          <% if session[:user].admin? %>
            <h5>Officer requirements</h5>
          	<div class="container">
          		<div class="cellRow cellRowHeader">
          			<div class="cellBlock">
          				Name
          			</div>
          			<div class="cellBlock">
          				Completed
          			</div>
          		</div>
              <% @officers.each_with_index do |officer, index| %>
                <% member = officer.member %>
              		<div class="cellRow cellRow<%= index % 2 + 1 %>">
              			<div class="cellBlock">
                      <%= link_to h(member.full_name), :controller => :members, :action => :show, :id => member.id %>
                    </div>
                    <div class="cellBlock" style="text-align: center">
                      <%= link_to officer.completed ? "Yes" : "No", :controller => :positions, :action => :toggle_complete, :id => member.id %>
                    </div>
                  </div>
              <% end %>
            </div>
          <% end %>
        </div>

    		<div class="container" style="float: right;">
          <h5>Members</h5>
      			If peoples' credits don't seem to be adding up,
    				<%= submit_tag "Refresh members" %>
    		  <h5>Branch battle :(</h5>
    		    <%= submit_tag "Randomly assign people to a branch" %>
          <h5>Members with admin priviledges:</h5>
          <% @admin.each do |member| %>
            <%= link_to h(member.full_name), :controller => :members, :action => :show, :id => member.id %>
            <br>
          <% end %>
    		</div>

      <% end %>
    <% else %>
	    <h2> <font color="red"> You do not have permission to view this page. </font> </h2>
	    <h3> If you feel that you should have permission, please email internet@apouiuc.com <h3>
    <% end %>
</div>
